package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ShopDemandMapper;
import com.ruoyi.system.domain.ShopDemand;
import com.ruoyi.system.service.IShopDemandService;

/**
 * 需求信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-06-03
 */
@Service
public class ShopDemandServiceImpl implements IShopDemandService 
{
    @Autowired
    private ShopDemandMapper shopDemandMapper;

    /**
     * 查询需求信息
     * 
     * @param demandId 需求信息主键
     * @return 需求信息
     */
    @Override
    public ShopDemand selectShopDemandByDemandId(Long demandId)
    {
        return shopDemandMapper.selectShopDemandByDemandId(demandId);
    }

    /**
     * 查询需求信息列表
     * 
     * @param shopDemand 需求信息
     * @return 需求信息
     */
    @Override
    public List<ShopDemand> selectShopDemandList(ShopDemand shopDemand)
    {
        return shopDemandMapper.selectShopDemandList(shopDemand);
    }

    /**
     * 新增需求信息
     * 
     * @param shopDemand 需求信息
     * @return 结果
     */
    @Override
    public int insertShopDemand(ShopDemand shopDemand)
    {
        shopDemand.setCreateTime(DateUtils.getNowDate());
        return shopDemandMapper.insertShopDemand(shopDemand);
    }

    /**
     * 修改需求信息
     * 
     * @param shopDemand 需求信息
     * @return 结果
     */
    @Override
    public int updateShopDemand(ShopDemand shopDemand)
    {
        shopDemand.setUpdateTime(DateUtils.getNowDate());
        return shopDemandMapper.updateShopDemand(shopDemand);
    }

    /**
     * 批量删除需求信息
     * 
     * @param demandIds 需要删除的需求信息主键
     * @return 结果
     */
    @Override
    public int deleteShopDemandByDemandIds(Long[] demandIds)
    {
        return shopDemandMapper.deleteShopDemandByDemandIds(demandIds);
    }

    /**
     * 删除需求信息信息
     * 
     * @param demandId 需求信息主键
     * @return 结果
     */
    @Override
    public int deleteShopDemandByDemandId(Long demandId)
    {
        return shopDemandMapper.deleteShopDemandByDemandId(demandId);
    }
}
